package com.sansan.qiangji.service.impl.base;

import com.sansan.qiangji.entity.base.Product;
import com.sansan.qiangji.entity.base.example.ProductExample;
import com.sansan.qiangji.form.base.ProductListForm;
import com.sansan.qiangji.mapper.base.ProductMapper;
import com.sansan.qiangji.service.inter.base.ProductService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class ProductServiceImpl implements ProductService {

    @Resource
    private ProductMapper productMapper;

    @Override
    public int updateProducts(List<Product> products) {
        return productMapper.updateProducts(products);
    }

    @Override
    public List<Product> selectProducts(List<Product> products) {
        return productMapper.selectProducts(products);
    }

    @Override
    public int insertProducts(List<Product> products) {
        return productMapper.insertProducts(products);
    }

    @Override
    public List<Product> findByProductCodeOrProductName(String productCode, String productName) {
        return productMapper.findByProductCodeOrProductName(productCode, productName);
    }

    @Override
    public long countByExample(ProductExample example) {

        return productMapper.countByExample(example);
    }

    @Override
    public int deleteByExample(ProductExample example) {
        return productMapper.deleteByExample(example);
    }

    @Override
    public int deleteByPrimaryKey(Integer productId) {
        return productMapper.deleteByPrimaryKey(productId);
    }

    @Override
    public int insert(Product record) {
        return productMapper.insert(record);
    }

    @Override
    public int insertSelective(Product record) {
        return productMapper.insertSelective(record);
    }

    @Override
    public List<Product> selectByExample(ProductExample example) {
        return productMapper.selectByExample(example);
    }

    @Override
    public Product selectByPrimaryKey(Integer productId) {
        return productMapper.selectByPrimaryKey(productId);
    }

    @Override
    public int updateByExampleSelective(Product record, ProductExample example) {
        return productMapper.updateByExampleSelective(record, example);
    }

    @Override
    public int updateByExample(Product record, ProductExample example) {
        return productMapper.updateByExample(record, example);
    }

    @Override
    public int updateByPrimaryKeySelective(Product record) {
        return productMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(Product record) {
        return productMapper.updateByPrimaryKey(record);
    }

    @Override
    public List<Product> selectListCondition(ProductListForm form) {
        return productMapper.selectListCondition(form);
    }
}
